import axios from 'axios';

const API_BASE_URL = '/api';

// 获取会议室列表
export const getMeetingRooms = async (params) => {
  try {
    const response = await axios.get(`${API_BASE_URL}/rooms`, { params });
    return response.data;
  } catch (error) {
    console.error('获取会议室列表失败', error);
    throw error;
  }
};

// 获取会议室详情
export const getRoomDetails = async (roomId) => {
  try {
    const response = await axios.get(`${API_BASE_URL}/rooms/${roomId}`);
    return response.data;
  } catch (error) {
    console.error('获取会议室详情失败', error);
    throw error;
  }
};  